/** 
 * @Title:统计报表 
 * @Desription:统计报表VO
 * @Company:CSN
 * @ClassName:ChartVo.java
 * @Author:Mengfh
 * @CreateDate:2013-11-15   
 * @UpdateUser:Mengfh
 * @Version:0.1 
 *    
 */ 

package com.midian.model.common.vo.report;

import java.io.Serializable;
import java.util.List;

import com.midian.common.utils.ChartHelper;

/** 
 * @ClassName: ChartVo 
 * @Description: 统计报表VO
 * @author: Mengfh
 * @date: 2013-11-15
 * 
 */
public class ChartVo implements Serializable {
	
	private static final long serialVersionUID = 229350767048651140L;
	/**报表类型*/
	private String type;
	/**标题*/
	private String title;
	/**副标题*/
	private String subTitle;
	/**X轴标题*/
	private String xaxisTitle;
	/**Y轴标题*/
	private String yaxisTitle;
	/**Y轴数值是否显示整型(默认值为假，即显示浮点型数据)*/
	private Boolean isDataInteger = false;
	/**是否将多组整合为一组*/
	private Boolean isMergeOneGroup = false;
	/**是否转换公司中文名称*/
	private Boolean isChnCompanyName = false;
	/**Y轴的最小值(默认值为0，如果设置为null即恢复自动设置)*/
	private Double yaxisMinVal = 0d;
	/**Y轴数值单位描述*/
	private String yaxisUnitDesc = "";
	/**是否显示图例*/
	private Boolean isLegend = true;
	/**是否显示标记(即折线图的点)*/
	private Boolean isMarker = true;
	/**是否显示X轴*/
	private Boolean isXaxisShow = true;
	/**是否显示Y轴*/
	private Boolean isYaxisShow = true;
	/**是否显示折线的点*/
	private Boolean isLineDataLabelsShow = false;
	/**是否显示所有分组的数据*/
	private Boolean isAllGroupShow = false;
	/**X轴名称列表*/
	private List<String> xaxisNameList;
	/**统计对象组列表*/
	private List<ReportGroupVo> reportGroupVoList;
	/**报表的显式宽度*/
	private Integer width;
	/**报表的显式高度*/
	private Integer height;
	/**统计节点所显示的数值的字体大小(单位：px)*/
	private String plotOptionsFontSize;
	/**X轴是否为数值(默认为假)*/
	private Boolean isXaxisNumber = false;
	/**X轴刻度*/
	private Double xaxisTickInterval;
	/**是否需要左右滚动报表*/
	private Boolean isScroll = false;
	/**X轴显示的最大值(用于左右滚动报表)*/
	private Double xaxisMaxVal;
	/**X轴显示的最大个数(用于左右滚动报表)*/
	private Integer xaxisMaxCount;
	/**是否将图例显示在右上角(东北方向)*/
	private Boolean isNeLegend = false;
	/**Y轴显示的最大值*/
	private Double yaxisMaxVal;
	/**Y轴刻度*/
	private Double yaxisTickInterval;
	/**是否需要隐藏线(折线图)*/
	private Boolean isHideLine = false;
	/**Y轴是否显示真正的数值(没有经过两位小数四舍五入)*/
	private Boolean isRealVal = false;
	/**标题字体大小，单位：px*/
	private String titleFontSize;
	
	public ChartVo() {
		
	}
	
	/**
	 * ChartVo构造函数
	 * @param type 报表类型
	 * @param title 标题
	 * @param subTitle 副标题
	 * @param xaxisTitle X轴标题
	 * @param yaxisTitle Y轴标题
	 * @param isDataInteger 是否显示整型
	 * @param isLegend 是否显示图例
	 */
	public ChartVo(String type, String title, String subTitle,
			String xaxisTitle, String yaxisTitle, Boolean isDataInteger, Boolean isLegend) {
		super();
		this.type = type;
		this.title = title;
		this.subTitle = subTitle;
		this.xaxisTitle = xaxisTitle;
		this.yaxisTitle = yaxisTitle;
		this.isDataInteger = isDataInteger;
		this.isLegend = isLegend;
	}
	
	/**
	 * ChartVo构造函数
	 * @param type 报表类型
	 * @param title 标题
	 * @param subTitle 副标题
	 * @param xaxisTitle X轴标题
	 * @param yaxisTitle Y轴标题
	 * @param isDataInteger 是否显示整型
	 * @param yaxisUnitDesc Y轴数值单位描述
	 * @param isLegend 是否显示图例
	 */
	public ChartVo(String type, String title, String subTitle,
			String xaxisTitle, String yaxisTitle, Boolean isDataInteger, String yaxisUnitDesc, Boolean isLegend) {
		super();
		this.type = type;
		this.title = title;
		this.subTitle = subTitle;
		this.xaxisTitle = xaxisTitle;
		this.yaxisTitle = yaxisTitle;
		this.isDataInteger = isDataInteger;
		this.yaxisUnitDesc = yaxisUnitDesc;
		this.isLegend = isLegend;
	}
	
	public String getTitleFontSize() {
		return titleFontSize;
	}

	public void setTitleFontSize(String titleFontSize) {
		this.titleFontSize = titleFontSize;
	}

	public Boolean getIsRealVal() {
		return isRealVal;
	}

	public void setIsRealVal(Boolean isRealVal) {
		this.isRealVal = isRealVal;
	}

	public Boolean getIsHideLine() {
		return isHideLine;
	}

	public void setIsHideLine(Boolean isHideLine) {
		this.isHideLine = isHideLine;
	}

	public Double getYaxisMaxVal() {
		return yaxisMaxVal;
	}

	public void setYaxisMaxVal(Double yaxisMaxVal) {
		this.yaxisMaxVal = yaxisMaxVal;
	}

	public Double getYaxisTickInterval() {
		return yaxisTickInterval;
	}

	public void setYaxisTickInterval(Double yaxisTickInterval) {
		this.yaxisTickInterval = yaxisTickInterval;
	}

	public Boolean getIsNeLegend() {
		return isNeLegend;
	}

	public void setIsNeLegend(Boolean isNeLegend) {
		this.isNeLegend = isNeLegend;
	}

	public Integer getXaxisMaxCount() {
		return xaxisMaxCount;
	}

	public void setXaxisMaxCount(Integer xaxisMaxCount) {
		this.xaxisMaxCount = xaxisMaxCount;
	}

	public Double getYaxisMinVal() {
		return yaxisMinVal;
	}

	public void setYaxisMinVal(Double yaxisMinVal) {
		this.yaxisMinVal = yaxisMinVal;
	}

	public Boolean getIsScroll() {
		return isScroll;
	}

	public void setIsScroll(Boolean isScroll) {
		this.isScroll = isScroll;
	}

	public Double getXaxisMaxVal() {
		return xaxisMaxVal;
	}

	public void setXaxisMaxVal(Double xaxisMaxVal) {
		this.xaxisMaxVal = xaxisMaxVal;
	}

	public Boolean getIsXaxisNumber() {
		return isXaxisNumber;
	}

	public void setIsXaxisNumber(Boolean isXaxisNumber) {
		this.isXaxisNumber = isXaxisNumber;
	}

	public Double getXaxisTickInterval() {
		return xaxisTickInterval;
	}

	public void setXaxisTickInterval(Double xaxisTickInterval) {
		this.xaxisTickInterval = xaxisTickInterval;
	}

	public String getPlotOptionsFontSize() {
		return plotOptionsFontSize;
	}

	public void setPlotOptionsFontSize(String plotOptionsFontSize) {
		this.plotOptionsFontSize = plotOptionsFontSize;
	}

	public Integer getWidth() {
		return width;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

	public Integer getHeight() {
		return height;
	}

	public void setHeight(Integer height) {
		this.height = height;
	}

	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getSubTitle() {
		return subTitle;
	}
	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}
	public String getXaxisTitle() {
		//不需要显示X轴，将X轴标题设置为空串
		if(this.isXaxisShow != null && !this.isXaxisShow) {
			return "";
		}
		return xaxisTitle;
	}
	public void setXaxisTitle(String xaxisTitle) {
		this.xaxisTitle = xaxisTitle;
	}
	public String getYaxisTitle() {
		//不需要显示Y轴，将Y轴标题设置为空串
		if(this.isYaxisShow != null && !this.isYaxisShow) {
			return "";
		}
		return yaxisTitle;
	}
	public void setYaxisTitle(String yaxisTitle) {
		this.yaxisTitle = yaxisTitle;
	}
	public Boolean getIsDataInteger() {
		return isDataInteger;
	}
	public void setIsDataInteger(Boolean isDataInteger) {
		this.isDataInteger = isDataInteger;
	}
	public Boolean getIsMergeOneGroup() {
		return isMergeOneGroup;
	}
	public void setIsMergeOneGroup(Boolean isMergeOneGroup) {
		this.isMergeOneGroup = isMergeOneGroup;
	}
	public Boolean getIsChnCompanyName() {
		return isChnCompanyName;
	}
	public void setIsChnCompanyName(Boolean isChnCompanyName) {
		this.isChnCompanyName = isChnCompanyName;
	}
	public String getYaxisUnitDesc() {
		return yaxisUnitDesc;
	}
	public void setYaxisUnitDesc(String yaxisUnitDesc) {
		this.yaxisUnitDesc = yaxisUnitDesc;
	}
	public Boolean getIsLegend() {
		return isLegend;
	}
	public void setIsLegend(Boolean isLegend) {
		this.isLegend = isLegend;
	}
	public Boolean getIsMarker() {
		return isMarker;
	}
	public void setIsMarker(Boolean isMarker) {
		this.isMarker = isMarker;
	}
	public List<String> getXaxisNameList() {
		return xaxisNameList;
	}
	public void setXaxisNameList(List<String> xaxisNameList) {
		this.xaxisNameList = xaxisNameList;
	}
	public List<ReportGroupVo> getReportGroupVoList() {
		//如果不是显示所有分组，并且报表类型是折线图，只显示前3条线，其它线默认隐藏
		if(!isAllGroupShow && ChartHelper.LINE.equals(type) 
				&& reportGroupVoList != null && !reportGroupVoList.isEmpty()) {
			for(int i = 0; i < reportGroupVoList.size(); i++) {
				if(i > 2) {
					reportGroupVoList.get(i).setVisible(false);
				}
			}
		} else if(!isAllGroupShow && (ChartHelper.BAR.equals(type) || ChartHelper.COLUMN.equals(type)) 
				&& reportGroupVoList != null && reportGroupVoList.size() > 1) {
		//如果不是显示所有分组，并且报表类型为柱状图，并且组的数量大于1的情况，默认将总体和1级进行隐藏
			for(ReportGroupVo reportGroupVo : reportGroupVoList) {
				String groupName = reportGroupVo.getGroupName(); //组名称
				if(ChartHelper.GROUPNAME_ALL.equals(groupName) || ChartHelper.GROUPNAME_LEVELONE.equals(groupName)) {
					reportGroupVo.setVisible(false);
				}
			}
		}
		return reportGroupVoList;
	}
	public void setReportGroupVoList(List<ReportGroupVo> reportGroupVoList) {
		this.reportGroupVoList = reportGroupVoList;
	}

	public Boolean getIsXaxisShow() {
		return isXaxisShow;
	}

	public void setIsXaxisShow(Boolean isXaxisShow) {
		this.isXaxisShow = isXaxisShow;
	}

	public Boolean getIsYaxisShow() {
		return isYaxisShow;
	}

	public void setIsYaxisShow(Boolean isYaxisShow) {
		this.isYaxisShow = isYaxisShow;
	}

	public Boolean getIsLineDataLabelsShow() {
		return isLineDataLabelsShow;
	}

	public void setIsLineDataLabelsShow(Boolean isLineDataLabelsShow) {
		this.isLineDataLabelsShow = isLineDataLabelsShow;
	}

	public Boolean getIsAllGroupShow() {
		return isAllGroupShow;
	}

	public void setIsAllGroupShow(Boolean isAllGroupShow) {
		this.isAllGroupShow = isAllGroupShow;
	}
}
